package com.aabte.design2.behavioral.memento.v2;

import java.util.Stack;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/5/4
 */
public class History {
    private Stack<Memento> history = new Stack<>();

    public void backup(Memento memento) {
        history.push(memento);
    }

    public void undo() {
        Memento memento = history.pop();
        memento.restore();
    }

}
